package wpspider.client.view.event;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

import wpspider.client.view.ComponentRepository;

public class ExitButtonEH implements ActionListener {

	public void actionPerformed(ActionEvent event) {
		ComponentRepository repos = ComponentRepository.getInstance();
		JFrame baseFrame = (JFrame) repos.getComponent("baseFrame");
		int answer = JOptionPane.showConfirmDialog(baseFrame, "Exit?", "", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); 
		if(answer == JOptionPane.OK_OPTION) {
			System.exit(0);
		}
	}
}
